package 循环;

import java.util.Scanner;

public class demo15 {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        System.out.println("请输入一个数");
        int a=sc.nextInt();
        int b =1;
        int sum =0;
        for(int i =1;i<=a ;i++){
            b*=i;
            sum+=b;
        }
        System.out.println();
    }
}
